
/* 
Run the naive OLS regressions
*/

set more off

estimates clear
clear

use ".\Dropbox\Vaccination\covid.dta" // load the dataset

drop if statefips==48|statefips==15 // drop states without the vaccination data

zscore(vacc* rep*2016) // standardize the variables

label variable z_rep_pres2016 "Trump vote share, 2016"
label variable z_rep_house2016 "Republican House vote share, 2016"


local county "lat lon temp rain income native_share white_share col_share elder_share male_share  mfg_share_diff popden" // county characteristics


** Trump vs Senate Rep share: separate regressions

// Trump 2016 share: without county controls
reg z_vaccinated_18pluspop_ratio z_rep_pres2016  i.statefips, cluster(statefips) 
estimates store trump_ols_geo

// Trump 2016 share: geo and socioeconomic controls 
reg z_vaccinated_18pluspop_ratio z_rep_pres2016 `county' i.statefips, cluster(statefips) 
estimates store trump_ols_socio

// Senate 2016 share: without county controls
reg z_vaccinated_18pluspop_ratio z_rep_house2016  i.statefips, cluster(statefips)
estimates store house_ols_geo

// Senate 2016 share: geo and socioeconomic controls 
reg z_vaccinated_18pluspop_ratio z_rep_house2016 `county' i.statefips, cluster(statefips)
estimates store house_ols_socio

// Horserace: without county controls
 reg z_vaccinated_18pluspop_ratio z_rep_pres2016 z_rep_house2016 i.statefips, cluster(statefips) 
estimates store both_ols_geo

// Horserace: geo and socioeconomic controls 
reg z_vaccinated_18pluspop_ratio z_rep_pres2016 z_rep_house2016  `county' i.statefips, cluster(statefips) 
estimates store both_ols_socio

estout trump_ols_* house* both* using ".\Dropbox\Vaccination\Draft\tab_separate_ols.tex", replace style(tex) cells(b(fmt(3) star) se(par fmt(3))) stats(r2 N, fmt(2 0) labels("R-squared" "Observations")) keep(z_rep_pres2016 z_rep_house2016) label mlabels(none) collabels(none) starlevels(* 0.10 ** 0.05 *** 0.01)